﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pagina/SiteMenu.Master" AutoEventWireup="true" CodeBehind="frmReceta_Registro.aspx.cs" Inherits="webbootstrap.Pagina.frmRecetaRegistro" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../style/css/smoothness/jquery-ui.css" rel="stylesheet" />
    <script src="../style/script/jquery-1.11.2.js"></script>
    <script src="../style/script/jquery-ui.js"></script>
    <link href="../style/css/smoothness/theme.css" rel="stylesheet" />
  
    <script type="text/javascript">

        function validar_monto(evt) {
            var keyPressed = (evt.which) ? evt.which : event.keyCode
            return !((keyPressed != 13) && (keyPressed != 46) && (keyPressed < 48 || keyPressed > 57));
        }

        function isInteger(s) {
            var i;
            for (i = 0; i < s.length; i++) {
                // Check that current character is number.
                var c = s.charAt(i);
                if (((c < "0") || (c > "9"))) return false;
            }
            // All characters are numbers.
            return true;
        }
    </script>
    <style type="text/css">
        /*#region name */
        .ocultar {
            display: none;
        }

        .alinearNumero {
            text-align: right;
        }
        /*#endregion */
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="ddlTipo" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="ddlClase" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="ddlDepartamento" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="ddlProvincia" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="ddlTipoProd" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="ddlProveedor" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="ddlProd" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="btnAgregar" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnCantidades" EventName="Click" />
        </Triggers>
        <ContentTemplate>
            <input id="hdcontador" type="hidden" value="0" />
            <input id="hdIdSlctTipoProd" type="hidden" />
            <input id="hdIdSlctProd" type="hidden" />
            <table>
                <tr>
                    <td style="width: 10px"></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td style="width: 10px"></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="4">Registro de Receta</td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>Tipo de plato :</td>
                    <td>
                        <asp:DropDownList ID="ddlTipo" runat="server">
                        </asp:DropDownList>
                    </td>
                    <td>Clase de plato :</td>
                    <td>
                        <asp:DropDownList ID="ddlClase" runat="server">
                        </asp:DropDownList>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>Departamento :</td>
                    <td>
                        <asp:DropDownList ID="ddlDepartamento" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlDepartamento_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                    <td>&nbsp;Provincia :</td>
                    <td>
                        <asp:DropDownList ID="ddlProvincia" runat="server">
                        </asp:DropDownList>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>COD Plato :</td>
                    <td>
                        <asp:TextBox ID="txtCodigo" runat="server" MaxLength="10"></asp:TextBox>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td></td>
                    <td>Nombre de Plato : </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtNombre" runat="server" MaxLength="100" Width="262px"></asp:TextBox>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="4">
                        <table>
                            <tr>
                                <td>Tipo de Producto</td>
                                <td>Proveedor</td>
                                <td>Producto</td>
                                <td></td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:DropDownList ID="ddlTipoProd" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlTipoProd_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlProveedor" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlProveedor_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlProd" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlProd_SelectedIndexChanged"></asp:DropDownList></td>
                                <td>
                                    <asp:Button ID="btnAgregar" runat="server" Text="Agregar" OnClick="btnAgregar_Click" />
                                    <asp:HiddenField ID="hdIdPrecio" runat="server" />
                                    <asp:HiddenField ID="hdPrecio" runat="server" />
                                </td>
                            </tr>
                        </table>
                        <br />
                        <br />
                        <asp:Button ID="btnCantidades" runat="server" Text="Registro Cantidad" OnClick="btnCantidades_Click" />
                        <input id="btnMostrar" type="button" value="Mostrar" />
                        <table>
                            <tr>
                                <td style="vertical-align: top">
                                    <br />
                                    <asp:GridView ID="gvProducto" runat="server" AutoGenerateColumns="False">
                                        <Columns>
                                            <asp:CommandField CausesValidation="False" InsertVisible="False" ShowCancelButton="False" ShowDeleteButton="True" />
                                            <asp:BoundField HeaderText="Tipo Producto" DataField="DESC_ITEMS" />
                                            <asp:BoundField HeaderText="Producto" DataField="NOM_PROD" />
                                            <asp:BoundField HeaderText="PRECIO" DataField="PRECIO_CIGV" ItemStyle-CssClass="alinearNumero" />
                                            <asp:BoundField HeaderText="IdTipoProd" DataField="ID_ITEMS" HeaderStyle-CssClass="ocultar" ItemStyle-CssClass="ocultar" />
                                            <asp:BoundField HeaderText="IdProd" DataField="ID_PRODUCTO" HeaderStyle-CssClass="ocultar" ItemStyle-CssClass="ocultar" />
                                            <asp:BoundField HeaderText="ID_PRECIO" DataField="ID_PRECIO" HeaderStyle-CssClass="ocultar" ItemStyle-CssClass="ocultar" />
                                        </Columns>
                                    </asp:GridView>
                                </td>
                                <td style="vertical-align: top">
                                    <%--                                    <table id="TbRegistro">
                                        <tbody id="tbProducto">
                                        </tbody>
                                    </table>--%>
                                    <asp:Label ID="lbTabla" runat="server"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
